package com.nbjtjc.safe.api.cost;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.nbjtjc.safe.bean.Result;
import com.nbjtjc.safe.model.cost.CostBudgetPlan;
import com.nbjtjc.safe.model.cost.CostBudgetSubItem;
import com.nbjtjc.safe.service.cost.CostBudgetMonthService;

@RestController
@CrossOrigin("*")
@RequestMapping("/costBudgetMonth")
public class CostBudgetMonthController {
	@Autowired
	private  CostBudgetMonthService costBudgetMonthService;
	
	
	  @RequestMapping(value = "/findByPlanId",method = {RequestMethod.POST})
	  public Result findByPlanId(@RequestBody CostBudgetPlan costBudgetPlan) {
	        Result result=new Result();
	        try {

	            result=costBudgetMonthService.findByPlanId(costBudgetPlan);

	        } catch (Exception e) {
	            e.printStackTrace();
	            result.setFalse(e.getMessage());
	        }
	        return result;
	  }

		  
	
}
